﻿using Core.DomainServices;
using Infrastructure.DomainServices;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Export2Excel
{
    /// <summary>
    /// This is a sample Export Timesheets to Excel files 
    /// Then using Microsoft.Office.Interop.Excel library to convert these files to pdf files.
    /// If you have any questions let me know, my email: bin.nguyen.van@gmail.com
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {

            IAppConfig appConfig = new AppConfig();
            IDataRepository repository = new EmployeeRepository();
            var timesheets = new DocumentService(repository, appConfig).CreateTimesheets(appConfig.OutputFolder);
            new DocumentConversion(appConfig).ConvertTo(timesheets);

            Console.WriteLine("===========DONE===========");
            Console.WriteLine("Output Data folder=> " + appConfig.OutputFolder);
            Console.ReadLine();
        }
    }
}
